Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that cached.csr always exists at the beginning #2636

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

Wenxing-hou
Copy link
Contributor

Fix: #2632

The successful unit_test will always make cached.csr name unchanged. But a failed unit_test may change cached.csr to cached.staging, which cause the next unit_test still failing even if the issue is fixed.

Add new api to ensure that cached.csr always exists at the beginning.

@Wenxing-hou
Copy link
Contributor Author

Hi @steven-bellock . Could you review this PR? Thanks.

@steven-bellock steven-bellock self-requested a review March 27, 2024 13:27
char *file_name = "test_csr/cached.staging";

rename(file_name, new_name);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete whitespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I have deleted it.

unit_test/test_spdm_responder/csr.c Outdated Show resolved Hide resolved
@@ -322,6 +332,9 @@ void libspdm_test_requester_get_csr_case1(void **state)
/*init req_info*/
libspdm_gen_req_info();

/*ensure that cached.csr exists in test_csr at the beginning*/
libspdm_clear_cached_csr();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to call this from libspdm_requester_get_csr_test_main.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I have moved the code location.

unit_test/test_spdm_responder/csr.c Outdated Show resolved Hide resolved
Fix the issue: DMTF#2632

The successful unit_test will always make cached.csr name unchanged.
But a failed unit_test may change cached.csr to cached.staging,
which cause the next unit_test still failing even if the issue is fixed.

Add new api to ensure that cached.csr always exists at the beginning.

Signed-off-by: Wenxing Hou <[email protected]>
@jyao1 jyao1 merged commit 887978a into DMTF:main Mar 30, 2024
97 checks passed
@Wenxing-hou Wenxing-hou deleted the fix_get_csr_unittest branch June 25, 2024 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSR unit test failure persistence
3 participants